package com.king.designpatterns.设计模式对比.创造型模式对比.建造者模式;

/**
 * 导演类
 *
 * @author king
 * @date 2021-06-16 17:08
 */
public class Director {
    private Builder builder;

    public SuperMan buildSuperMan(String name) {
        if ("child".equals(name)) {
            builder = new ChildSuperManBuilder();
        } else if ("adult".equals(name)) {
            builder = new AdultSuperManBuilder();
        } else {
            return null;
        }
        builder.setBody();
        builder.setSpecialTalent();
        builder.setSpecialSymbol();
        return builder.getSuperMan();
    }
}
